/* MyImg 页面样式 - 紧凑美观版本 */

// 主容器样式
.MyImg {
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

// 头部区域
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: white;
  padding: 24px 28px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);

  .titleSection {
    .title {
      margin: 0 0 4px 0;
      font-size: 24px;
      font-weight: 700;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .subtitle {
      font-size: 14px;
      color: #6b7280;
      margin: 0;
    }
  }

  .uploadBtn {
    border-radius: 8px;
    height: 40px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
    transition: all 0.3s ease;

    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 16px rgba(24, 144, 255, 0.4);
    }
  }
}

// 搜索卡片
.searchCard {
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);

  .searchWrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;

    .searchInput {
      flex: 1;
      max-width: 400px;
      border-radius: 8px;
      border: 1px solid #e5e7eb;
      transition: all 0.3s ease;

      &:hover, &:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
      }

      .searchIcon {
        color: #9ca3af;
        font-size: 14px;
      }
    }

    .statsInfo {
      font-size: 13px;
      color: #6b7280;
      font-weight: 500;
    }
  }
}

// 数据展示区域
.dataDisplay {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

// 图片卡片样式
.imageCard {
  border-radius: 8px !important;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
  }

  // 图片容器
  .imageContainer {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #f9fafb;
    background-image: 
      linear-gradient(45deg, #f3f4f6 25%, transparent 25%), 
      linear-gradient(-45deg, #f3f4f6 25%, transparent 25%), 
      linear-gradient(45deg, transparent 75%, #f3f4f6 75%), 
      linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;

    &:hover {
      .imageOverlay {
        opacity: 1;
      }
    }
  }

  // 图片样式
  .image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }

  // 悬停操作层
  .imageOverlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);

    .actionBtn {
      background: rgba(255, 255, 255, 0.9);
      border: none;
      color: #374151;
      width: 32px;
      height: 32px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;

      &:hover {
        background: white;
        color: #667eea;
        transform: scale(1.1);
      }

      &.ant-btn-dangerous {
        &:hover {
          background: #fee2e2;
          color: #ef4444;
        }
      }
    }
  }

  // 卡片内容
  .ant-card-body {
    padding: 12px !important;
    background: white;
  }

  // 图片标题
  .imageTitle {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  // 图片信息
  .imageInfo {
    margin-top: 4px;

    .imageSize {
      font-size: 11px;
      color: #6b7280;
      font-weight: 500;
    }
  }
}

// 分页区域
.paginationWrapper {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

// 子组件容器
.childrenContainer {
  margin-top: 20px;
}

// 响应式设计
@media (max-width: 1200px) {
  .imageCard {
    .imageContainer {
      height: 120px;
    }
  }
}

@media (max-width: 768px) {
  .MyImg {
    padding: 16px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;

    .titleSection {
      text-align: center;

      .title {
        font-size: 20px;
      }
    }

    .uploadBtn {
      width: 100%;
    }
  }

  .searchCard {
    .searchWrapper {
      flex-direction: column;
      gap: 12px;

      .searchInput {
        max-width: 100%;
      }
    }
  }

  .dataDisplay {
    padding: 16px;
  }

  .imageCard {
    .imageContainer {
      height: 100px;
    }
  }
}

@media (max-width: 480px) {
  .imageCard {
    .imageContainer {
      height: 80px;
    }

    .imageTitle {
      font-size: 12px;
    }

    .imageSize {
      font-size: 10px;
    }
  }
}

// 全局样式覆盖
:global {
  .ant-list-item {
    padding: 6px !important;
  }

  .ant-card-meta-title {
    margin-bottom: 4px !important;
  }

  .ant-card-meta-description {
    color: #6b7280 !important;
  }

  .ant-pagination {
    .ant-pagination-item {
      border-radius: 6px;
      border: 1px solid #e5e7eb;
      transition: all 0.3s ease;

      &:hover {
        border-color: #667eea;
        color: #667eea;
      }

      &.ant-pagination-item-active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-color: transparent;

        a {
          color: white;
        }
      }
    }

    .ant-pagination-prev,
    .ant-pagination-next {
      border-radius: 6px;
      transition: all 0.3s ease;

      &:hover {
        border-color: #667eea;
        color: #667eea;
      }
    }
  }

  .ant-spin-container {
    border-radius: 8px;
  }

  .ant-modal {
    .ant-modal-content {
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }

    .ant-modal-header {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-bottom: none;
      padding: 20px 24px;

      .ant-modal-title {
        color: white;
        font-weight: 600;
      }
    }

    .ant-modal-close {
      color: white;
      top: 20px;
      right: 20px;

      &:hover {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
      }
    }
  }
}